package com.example.demo.AOPTest;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class AopAspect {
    @Pointcut("@annotation(com.example.demo.AOPTest.MyAspect)")
    public void fun1(){

    }

    @Before("fun1()")
    public void fun2(){
        System.out.println("前置方法");
    }
    @After("fun1()")
    public void fun3(){
        System.out.println("后置方法");
    }
}
